<?php
$str=<<<XML
<?xml version="1.0" encoding="UTF-8"?>
<root>
</root>
XML;
$new=new DOMDocument();
$new->loadXML("$str");
$root=$new->documentElement;
$header=$new->createElement("header");
$header->appendChild($new->createTextNode("表白书"));
$root->appendChild($header);
echo $new->saveXML();
?>